import { getElementPosition, getPageSize, getScrolled, getViewportSize } from "@/libs/tools"
import { IElPayLoad } from "../typings/index";
export default {
    setScroll(state: any): void {
        state.scrolled = getScrolled();
        state.pageSize = getPageSize();
        state.viewportSize = getViewportSize();
    },
    setElementPosition(state: any, payLoad: IElPayLoad): void {
        const ElName: string = payLoad.name + 'Position';
        state[ElName] = getElementPosition(payLoad.El);
    },
    setAnchor(state: any, newAnchor: string) {
        state.anchor = newAnchor;
    }
}